\hypertarget{mathio_8c}{}\section{printf/mathio.c File Reference}
\label{mathio_8c}\index{printf/mathio.\+c@{printf/mathio.\+c}}


String to number conversions with floating point support.  


{\ttfamily \#include $<$stdint.\+h$>$}\\*
{\ttfamily \#include $<$stdarg.\+h$>$}\\*
{\ttfamily \#include $<$string.\+h$>$}\\*
{\ttfamily \#include \char`\"{}mathio.\+h\char`\"{}}\\*
{\ttfamily \#include $<$math.\+h$>$}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{mathio_8c_a8c0b521d598596dde4e31d56f672ad76}{atodigit} (int c, int radix)
\begin{DoxyCompactList}\small\item\em Convert A\+S\+C\+II character to radix based digit , or -\/1. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} long \hyperlink{mathio_8c_a65e529a87a8bcaf0b2cb9b6edc3a8fde}{atoh} (const char $\ast$p)
\begin{DoxyCompactList}\small\item\em Convert A\+S\+C\+II hex string to long integer. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} long \hyperlink{mathio_8c_a5fb184d7bd50561c60bf64b7cda0eb62}{aton} (char $\ast$str, int base)
\begin{DoxyCompactList}\small\item\em Convert A\+S\+C\+II string to number in a given base. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{mathio_8c_aee46e805a6a25105661e6486a419fdc3}{mul10str} (\hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$str, int size)
\begin{DoxyCompactList}\small\item\em Fast multiply number of any size by 10. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} long \hyperlink{mathio_8c_ae7a25f0631dd53c026fd8636e8bcb42e}{strtol} (const char $\ast$nptr, char $\ast$$\ast$endptr, int base)
\begin{DoxyCompactList}\small\item\em Convert A\+S\+C\+II string to number in a given base. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} long long \hyperlink{mathio_8c_a00a26430103adfe060136c98afc39cab}{strtoll} (const char $\ast$nptr, char $\ast$$\ast$endptr, int base)
\begin{DoxyCompactList}\small\item\em Convert A\+S\+C\+II string to number in a given base. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{mathio_8c_ae640e0202e5f4904efa121a07af97c5e}{atoi} (const char $\ast$str)
\begin{DoxyCompactList}\small\item\em Convert A\+S\+C\+II string to number in base 10. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} long \hyperlink{mathio_8c_ae952cb1ae6aec6b2b6c02ae67e9ea87b}{atol} (const char $\ast$str)
\begin{DoxyCompactList}\small\item\em Convert A\+S\+C\+II string to number in base 10. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
String to number conversions with floating point support. 

\begin{DoxyParagraph}{Copyright \copyright{} 2014-\/2017 Mike Gore, All rights reserved. G\+PL License}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\href{http://github.com/magore/hp85disk}{\tt http\+://github.\+com/magore/hp85disk} 

\href{http://github.com/magore/hp85disk/COPYRIGHT.md}{\tt http\+://github.\+com/magore/hp85disk/\+C\+O\+P\+Y\+R\+I\+G\+H\+T.\+md} for specific Copyright details
\end{DoxySeeAlso}
\begin{DoxyParagraph}{You are free to use this code under the terms of G\+PL}
please retain a copy of this notice in any code you use it in.
\end{DoxyParagraph}
This is free software\+: you can redistribute it and/or modify it under the terms of the G\+NU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but W\+I\+T\+H\+O\+UT A\+NY W\+A\+R\+R\+A\+N\+TY; without even the implied warranty of M\+E\+R\+C\+H\+A\+N\+T\+A\+B\+I\+L\+I\+TY or F\+I\+T\+N\+E\+SS F\+OR A P\+A\+R\+T\+I\+C\+U\+L\+AR P\+U\+R\+P\+O\+SE. See the G\+NU General Public License for more details.

You should have received a copy of the G\+NU General Public License along with this program. If not, see \href{http://www.gnu.org/licenses/}{\tt http\+://www.\+gnu.\+org/licenses/}. 

\subsection{Function Documentation}
\index{mathio.\+c@{mathio.\+c}!atodigit@{atodigit}}
\index{atodigit@{atodigit}!mathio.\+c@{mathio.\+c}}
\subsubsection[{\texorpdfstring{atodigit(int c, int radix)}{atodigit(int c, int radix)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int atodigit (
\begin{DoxyParamCaption}
\item[{int}]{c, }
\item[{int}]{radix}
\end{DoxyParamCaption}
)}\hypertarget{mathio_8c_a8c0b521d598596dde4e31d56f672ad76}{}\label{mathio_8c_a8c0b521d598596dde4e31d56f672ad76}


Convert A\+S\+C\+II character to radix based digit , or -\/1. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em c} & character \\
\hline
\mbox{\tt in}  & {\em radix} & radix \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
radix based digit , or -\/1 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{mathio_8c_ae7a25f0631dd53c026fd8636e8bcb42e}{strtol} 
\end{DoxySeeAlso}


Definition at line 58 of file mathio.\+c.



Referenced by process\+\_\+args(), strtol(), and strtoll().

\index{mathio.\+c@{mathio.\+c}!atoh@{atoh}}
\index{atoh@{atoh}!mathio.\+c@{mathio.\+c}}
\subsubsection[{\texorpdfstring{atoh(const char $\ast$p)}{atoh(const char *p)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} long atoh (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{p}
\end{DoxyParamCaption}
)}\hypertarget{mathio_8c_a65e529a87a8bcaf0b2cb9b6edc3a8fde}{}\label{mathio_8c_a65e529a87a8bcaf0b2cb9b6edc3a8fde}


Convert A\+S\+C\+II hex string to long integer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em p} & String to convert.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
long integer result. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{mathio_8c_ae7a25f0631dd53c026fd8636e8bcb42e}{strtol()} for return overflow and underflow results. 
\end{DoxySeeAlso}


Definition at line 79 of file mathio.\+c.

\index{mathio.\+c@{mathio.\+c}!atoi@{atoi}}
\index{atoi@{atoi}!mathio.\+c@{mathio.\+c}}
\subsubsection[{\texorpdfstring{atoi(const char $\ast$str)}{atoi(const char *str)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int atoi (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{str}
\end{DoxyParamCaption}
)}\hypertarget{mathio_8c_ae640e0202e5f4904efa121a07af97c5e}{}\label{mathio_8c_ae640e0202e5f4904efa121a07af97c5e}


Convert A\+S\+C\+II string to number in base 10. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em str} & string \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int value 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{mathio_8c_ae7a25f0631dd53c026fd8636e8bcb42e}{strtol} 
\end{DoxySeeAlso}


Definition at line 281 of file mathio.\+c.



Referenced by html\+\_\+status(), main(), parse\+\_\+http\+\_\+request(), posix\+\_\+tests(), Read\+Bdf(), and user\+\_\+tests().

\index{mathio.\+c@{mathio.\+c}!atol@{atol}}
\index{atol@{atol}!mathio.\+c@{mathio.\+c}}
\subsubsection[{\texorpdfstring{atol(const char $\ast$str)}{atol(const char *str)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} long atol (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{str}
\end{DoxyParamCaption}
)}\hypertarget{mathio_8c_ae952cb1ae6aec6b2b6c02ae67e9ea87b}{}\label{mathio_8c_ae952cb1ae6aec6b2b6c02ae67e9ea87b}


Convert A\+S\+C\+II string to number in base 10. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em str} & string \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
long value 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{mathio_8c_ae7a25f0631dd53c026fd8636e8bcb42e}{strtol} 
\end{DoxySeeAlso}


Definition at line 295 of file mathio.\+c.



Referenced by fatfs\+\_\+tests().

\index{mathio.\+c@{mathio.\+c}!aton@{aton}}
\index{aton@{aton}!mathio.\+c@{mathio.\+c}}
\subsubsection[{\texorpdfstring{aton(char $\ast$str, int base)}{aton(char *str, int base)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} long aton (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{str, }
\item[{int}]{base}
\end{DoxyParamCaption}
)}\hypertarget{mathio_8c_a5fb184d7bd50561c60bf64b7cda0eb62}{}\label{mathio_8c_a5fb184d7bd50561c60bf64b7cda0eb62}


Convert A\+S\+C\+II string to number in a given base. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em str} & string \\
\hline
\mbox{\tt in}  & {\em base} & radix \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
long value 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{mathio_8c_ae7a25f0631dd53c026fd8636e8bcb42e}{strtol} 
\end{DoxySeeAlso}


Definition at line 93 of file mathio.\+c.

\index{mathio.\+c@{mathio.\+c}!mul10str@{mul10str}}
\index{mul10str@{mul10str}!mathio.\+c@{mathio.\+c}}
\subsubsection[{\texorpdfstring{mul10str(uint8\+\_\+t $\ast$str, int size)}{mul10str(uint8_t *str, int size)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int mul10str (
\begin{DoxyParamCaption}
\item[{{\bf uint8\+\_\+t} $\ast$}]{str, }
\item[{int}]{size}
\end{DoxyParamCaption}
)}\hypertarget{mathio_8c_aee46e805a6a25105661e6486a419fdc3}{}\label{mathio_8c_aee46e805a6a25105661e6486a419fdc3}


Fast multiply number of any size by 10. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em str} & string \\
\hline
\mbox{\tt in}  & {\em size} & string size \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
non-\/zero on overflow , 0 if ok 
\end{DoxyReturn}


Definition at line 108 of file mathio.\+c.

\index{mathio.\+c@{mathio.\+c}!strtol@{strtol}}
\index{strtol@{strtol}!mathio.\+c@{mathio.\+c}}
\subsubsection[{\texorpdfstring{strtol(const char $\ast$nptr, char $\ast$$\ast$endptr, int base)}{strtol(const char *nptr, char **endptr, int base)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} long strtol (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{nptr, }
\item[{char $\ast$$\ast$}]{endptr, }
\item[{int}]{base}
\end{DoxyParamCaption}
)}\hypertarget{mathio_8c_ae7a25f0631dd53c026fd8636e8bcb42e}{}\label{mathio_8c_ae7a25f0631dd53c026fd8636e8bcb42e}


Convert A\+S\+C\+II string to number in a given base. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em nptr} & string \\
\hline
\mbox{\tt in}  & {\em endptr} & pointer to string pointer return value \\
\hline
\mbox{\tt in}  & {\em base} & radix \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
long value 
\end{DoxyReturn}


Definition at line 136 of file mathio.\+c.



Referenced by atoh(), atoi(), atol(), aton(), get\+\_\+value(), main(), posix\+\_\+tests(), and setdate\+\_\+r().

\index{mathio.\+c@{mathio.\+c}!strtoll@{strtoll}}
\index{strtoll@{strtoll}!mathio.\+c@{mathio.\+c}}
\subsubsection[{\texorpdfstring{strtoll(const char $\ast$nptr, char $\ast$$\ast$endptr, int base)}{strtoll(const char *nptr, char **endptr, int base)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} long long strtoll (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{nptr, }
\item[{char $\ast$$\ast$}]{endptr, }
\item[{int}]{base}
\end{DoxyParamCaption}
)}\hypertarget{mathio_8c_a00a26430103adfe060136c98afc39cab}{}\label{mathio_8c_a00a26430103adfe060136c98afc39cab}


Convert A\+S\+C\+II string to number in a given base. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em nptr} & string \\
\hline
\mbox{\tt in}  & {\em endptr} & pointer to string pointer return value \\
\hline
\mbox{\tt in}  & {\em base} & radix \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
long long 
\end{DoxyReturn}


Definition at line 183 of file mathio.\+c.

